import { xhrPostJson } from '@/services';
import { DynamicObjectAny } from '@/typings';

const baseUrl = '/arcv';

const api = {
  delete: `${baseUrl}/ctgry/delete`,
  detail: `${baseUrl}/ctgry/detail`,
  list: `${baseUrl}/ctgry/list`,
  page: `${baseUrl}/ctgry/page`,
  tree: `${baseUrl}/ctgry/tree`,
  create: `${baseUrl}/ctgry/create`,
  update: `${baseUrl}/ctgry/update`,
};

// 新增
export const categoryCreate = (params: DynamicObjectAny) => {
  return xhrPostJson(api.create, params);
};
// 编辑
export const categoryUpdate = (params: DynamicObjectAny) => {
  return xhrPostJson(api.update, params);
};
// 删除
export const categoryDelete = (params: DynamicObjectAny) => {
  return xhrPostJson(api.delete, params);
};

export default api;
